# -*- coding: utf-8 -*-

#Author: Yuanhao Li <jay_21cn@hotmail.com>
#File: ingcapp_ui.py
#Usage: Client of ING from project Babel
#Copyright (C) 2007 Yuanhao Li<jay_21cn@hotmail.com>

#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.

#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.

#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software Foundation,
#Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

#本程序是遵从 GPL 2.0 许可发布的. 你可以自由修改和再发布本程序, 
#但请遵守 GPL 2.0 条款, 尊重知识产权.

import sys, os

from PyQt4 import QtCore, QtGui

cwd = os.path.split(sys.argv[0])[0]
if not cwd:
	cwd = os.getcwd()

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,460,440).size()).expandedTo(MainWindow.minimumSizeHint()))

        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(0),QtGui.QSizePolicy.Policy(0))
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        MainWindow.setWindowIcon(QtGui.QIcon(cwd + "/pixmaps/ingc.png"))

        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")

        self.vboxlayout = QtGui.QVBoxLayout(self.centralwidget)
        self.vboxlayout.setMargin(2)
        self.vboxlayout.setSpacing(0)
        self.vboxlayout.setObjectName("vboxlayout")

        self.splitter = QtGui.QSplitter(self.centralwidget)

        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(7),QtGui.QSizePolicy.Policy(7))
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.splitter.sizePolicy().hasHeightForWidth())
        self.splitter.setSizePolicy(sizePolicy)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setOpaqueResize(True)
        self.splitter.setChildrenCollapsible(True)
        self.splitter.setObjectName("splitter")

        self.tabWidget = QtGui.QTabWidget(self.splitter)

        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(7),QtGui.QSizePolicy.Policy(7))
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.tabWidget.sizePolicy().hasHeightForWidth())
        self.tabWidget.setSizePolicy(sizePolicy)
        self.tabWidget.setTabShape(QtGui.QTabWidget.Rounded)
        self.tabWidget.setIconSize(QtCore.QSize(16,16))
        self.tabWidget.setElideMode(QtCore.Qt.ElideRight)
        self.tabWidget.setUsesScrollButtons(True)
        self.tabWidget.setObjectName("tabWidget")

        self.tab = QtGui.QWidget()
        self.tab.setObjectName("tab")

        self.vboxlayout1 = QtGui.QVBoxLayout(self.tab)
        self.vboxlayout1.setMargin(0)
        self.vboxlayout1.setSpacing(0)
        self.vboxlayout1.setObjectName("vboxlayout1")

        self.textBrowser = QtGui.QTextBrowser(self.tab)

        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(7),QtGui.QSizePolicy.Policy(7))
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.textBrowser.sizePolicy().hasHeightForWidth())
        self.textBrowser.setSizePolicy(sizePolicy)
        self.textBrowser.setMaximumSize(QtCore.QSize(16777215,400))
        self.textBrowser.setAcceptDrops(False)
        self.textBrowser.setObjectName("textBrowser")
        self.vboxlayout1.addWidget(self.textBrowser)
        self.tabWidget.addTab(self.tab, QtGui.QIcon(cwd + "/pixmaps/ingc.png"), "")

        self.textEdit = QtGui.QTextEdit(self.splitter)

        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Policy(7),QtGui.QSizePolicy.Policy(0))
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.textEdit.sizePolicy().hasHeightForWidth())
        self.textEdit.setSizePolicy(sizePolicy)
        self.textEdit.setMaximumSize(QtCore.QSize(16777215,80))
        self.textEdit.setBaseSize(QtCore.QSize(0,0))
        self.textEdit.setObjectName("textEdit")
        self.vboxlayout.addWidget(self.splitter)
        MainWindow.setCentralWidget(self.centralwidget)

        self.toolBar = QtGui.QToolBar(MainWindow)
        self.toolBar.setMovable(False)
        self.toolBar.setOrientation(QtCore.Qt.Horizontal)
        self.toolBar.setObjectName("toolBar")
        MainWindow.addToolBar(self.toolBar)

        self.actionConnect = QtGui.QAction(MainWindow)
        self.actionConnect.setIcon(QtGui.QIcon(cwd + "/pixmaps/connect.png"))
        self.actionConnect.setObjectName("actionConnect")

        self.actionDisconnect = QtGui.QAction(MainWindow)
        self.actionDisconnect.setIcon(QtGui.QIcon(cwd + "/pixmaps/disconnect.png"))
        self.actionDisconnect.setObjectName("actionDisconnect")

        #self.actionOption = QtGui.QAction(MainWindow)
        #self.actionOption.setIcon(QtGui.QIcon("pixmaps/option.png"))
        #self.actionOption.setObjectName("actionOption")

        self.actionReconnect = QtGui.QAction(MainWindow)
        self.actionReconnect.setIcon(QtGui.QIcon(cwd + "/pixmaps/reconnect.png"))
        self.actionReconnect.setObjectName("actionReconnect")

        self.actionExit = QtGui.QAction(MainWindow)
        self.actionExit.setIcon(QtGui.QIcon(cwd + "/pixmaps/exit.png"))
        self.actionExit.setObjectName("actionExit")
        self.toolBar.addAction(self.actionConnect)
        self.toolBar.addAction(self.actionDisconnect)
        self.toolBar.addAction(self.actionReconnect)
        #self.toolBar.addAction(self.actionOption)
        self.toolBar.addAction(self.actionExit)

        self.statusbar = QtGui.QStatusBar(MainWindow)
        MainWindow.setStatusBar(self.statusbar)

        self.retranslateUi(MainWindow)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
        MainWindow.setTabOrder(self.tabWidget,self.textEdit)
        MainWindow.setTabOrder(self.textEdit,self.textBrowser)

    def retranslateUi(self, MainWindow):
        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "INGC", None, QtGui.QApplication.UnicodeUTF8))
        self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("MainWindow", "关于", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConnect.setText(QtGui.QApplication.translate("MainWindow", "连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConnect.setIconText(QtGui.QApplication.translate("MainWindow", "连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConnect.setToolTip(QtGui.QApplication.translate("MainWindow", "连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConnect.setStatusTip(QtGui.QApplication.translate("MainWindow", "连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionConnect.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+L", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDisconnect.setText(QtGui.QApplication.translate("MainWindow", "断开", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDisconnect.setIconText(QtGui.QApplication.translate("MainWindow", "断开", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDisconnect.setToolTip(QtGui.QApplication.translate("MainWindow", "断开", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDisconnect.setStatusTip(QtGui.QApplication.translate("MainWindow", "断开", None, QtGui.QApplication.UnicodeUTF8))
        self.actionDisconnect.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+D", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReconnect.setText(QtGui.QApplication.translate("MainWindow", "重新连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReconnect.setIconText(QtGui.QApplication.translate("MainWindow", "重新连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReconnect.setToolTip(QtGui.QApplication.translate("MainWindow", "重新连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReconnect.setStatusTip(QtGui.QApplication.translate("MainWindow", "重新连接", None, QtGui.QApplication.UnicodeUTF8))
        self.actionReconnect.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+R", None, QtGui.QApplication.UnicodeUTF8))
        #self.actionOption.setText(QtGui.QApplication.translate("MainWindow", "选项", None, QtGui.QApplication.UnicodeUTF8))
        #self.actionOption.setIconText(QtGui.QApplication.translate("MainWindow", "选项", None, QtGui.QApplication.UnicodeUTF8))
        #self.actionOption.setToolTip(QtGui.QApplication.translate("MainWindow", "选项", None, QtGui.QApplication.UnicodeUTF8))
        #self.actionOption.setStatusTip(QtGui.QApplication.translate("MainWindow", "选项", None, QtGui.QApplication.UnicodeUTF8))
        #self.actionOption.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "退出", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setIconText(QtGui.QApplication.translate("MainWindow", "退出", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setToolTip(QtGui.QApplication.translate("MainWindow", "退出", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setStatusTip(QtGui.QApplication.translate("MainWindow", "退出", None, QtGui.QApplication.UnicodeUTF8))
        self.actionExit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))

